home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group97b.txt
/
000004_icon-group-sender _Fri Jun 27 10:54:19 1997.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
2KB
Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Fri, 27 Jun 1997 12:36:24 MST
Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM)
id AA18215; Fri, 27 Jun 1997 12:36:24 -0700
Date: Fri, 27 Jun 1997 10:54:19 -0700
From: Gregg Townsend <gmt>
Message-Id: <9706271754.AA10927@hawk.CS.Arizona.EDU>
To: icon-group
Subject: Re: Process ID availability
Cc: lane@mcc.com
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
If your Icon platform supports loadable C functions, you can call the
getpid() function that's in the Icon Program Library. If you installed
the Icon Starter Kit (prebuilt binaries) for Solaris, SunOS, Linux,
Digital Unix, or Irix, the function is immediately available for linking:
link cfunc
procedure main()
write(getpid())
end
Reading from a pipe is another approach. On systems where the Korn Shell
(ksh) is available, the pipe program can be simplified to this:
procedure main()
write(readpid())
end
procedure readpid()
pipe := open("exec ksh -c 'echo $PPID'","pr")
pid := integer(read(pipe))
close(pipe)
return pid
end
-----------------------------------------------------------------------------
Gregg Townsend Gould-Simpson Building gmt@cs.arizona.edu
Staff Scientist 1040 E. 4th St. 32 13 45N 110 57 16W
Dept. of Computer Science PO Box 210077 tel: +1 520 621 4325
The University of Arizona Tucson, AZ 85721-0077 fax: +1 520 621 4246